<template>
    <div>
        <van-nav-bar
                title="物流状态"
                left-text="返回"
                right-text=""
                left-arrow
                @click-left="onClickLeft"/>
    <van-steps direction="vertical"  :active="1" v-if="orderStatus==1">
        <van-step>
            <h3>订单已完成</h3>
            <p>2021-03-15 09:30</p>
        </van-step>
        <van-step>
            <h3>【成都市】商品已打包商品待发货</h3>
            <p>2021-03-15 10:00</p>
        </van-step>
    </van-steps>
<!--        =============商品运输中======================-->
        <van-steps direction="vertical" :active="3" v-if="orderStatus==2">
            <van-step>
                <h3>订单已完成</h3>
                <p>2021-03-15 09:30</p>
            </van-step>
            <van-step>
                <h3>【成都市】商品已打包商品待发货</h3>
                <p>2021-03-15 10:00</p>
            </van-step>
            <van-step>
                <h3>【成都市】商品已发货</h3>
                <p>2021-03-15 16:00</p>
            </van-step>
            <van-step>
                <h3>【成都市】商品已从成都市发出</h3>
                <p>2021-03-15 16:00</p>
            </van-step>
            <van-step>
                <h3>【收】{{address.addressContent}}</h3>
                <p>2021-03-15 16:00</p>
            </van-step>
        </van-steps>
        <!--        =============商品已收货======================-->
        <van-steps direction="vertical" :active="4" v-if="orderStatus==3">
            <van-step>
                <h3>订单已完成</h3>
                <p>2021-03-15 09:30</p>
            </van-step>
            <van-step>
                <h3>【成都市】商品已打包商品待发货</h3>
                <p>2021-03-15 10:00</p>
            </van-step>
            <van-step>
                <h3>【成都市】商品已发货</h3>
                <p>2021-03-15 16:00</p>
            </van-step>
            <van-step>
                <h3>【成都市】商品已从成都市发出</h3>
                <p>2021-03-15 16:00</p>
            </van-step>
            <van-step>
                <h3>【已收货】{{address.addressContent}}</h3>
                <p>2021-03-15 16:00</p>
            </van-step>
        </van-steps>
    </div>
</template>

<script>
    export default {
        name: "logisticsStatus",
        data() {
            return {
                active: 1,
                address:'',
                orderStatus:''
            };
        },
        methods:{
            onClickLeft(){
                this.$router.push({name:'logisticsNews'})
            }
        },
        created() {
            this.orderStatus=this.$route.params.orderStatus

            this.$axios.post('/api/address/list?userId='+3).then((res)=>{
                res.data.data.forEach((item)=>{
                    if (item.isDefault===1){
                        this.address=item
                        console.log(this.address)
                    }
                })
                // console.log(res.data.data)
            })
        }
    }
</script>

<style scoped>

</style>